elimination method for solving system of equations